package com.szrt.day20170420.ch02;

public class Student implements Programmer {
	
	
	private int age;
	
	private String name;
	
	
	

	public Student(int age, String name) {
		super();
		this.age = age;
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "Student [age=" + age + ", name=" + name + "]";
	}
	
	@Override
	public boolean equals(Object obj) {
		
		//需求 只要 姓名相等  就认为是同1个人
		
		Student student =(Student)obj;
		
		String nameChuan = student.getName();
		
		if(nameChuan.equals(this.name)){
			
			return true;
		}else{
			return false;
		}
	}
	
	

}
